import request from '@/utils/request'

// 查询商品主体信息列表
export function listMain(query) {
  return request({
    url: '/goods/main/list',
    method: 'get',
    params: query
  })
}

// 查询商品主体信息详细
export function getMain(goodsId) {
  return request({
    url: '/goods/main/' + goodsId,
    method: 'get'
  })
}

export function getMainByGNumber(gNumber) {
  return request({
    url: '/goods/main/findMain/' + gNumber,
    method: 'get'
  })
}

// 新增商品主体信息
export function addMain(data) {
  return request({
    url: '/goods/main',
    method: 'post',
    data: data
  })
}

// 修改商品主体信息
export function updateMain(data) {
  return request({
    url: '/goods/main',
    method: 'put',
    data: data
  })
}

// 删除商品主体信息
export function delMain(gNumber) {
  return request({
    url: '/goods/main/' + gNumber,
    method: 'delete'
  })
}


export function optionSelect() {
  return request({
    url: '/goods/main/optionSelect',
    method: 'get'
  })
}

// 查询商品最大顺序值
export function findMaxOrderNum(assNumber) {
  return request({
    url: '/goods/main/findMaxOrderNum/' + assNumber,
    method: 'get'
  })
}

// 查询商品分类信息
export function getAssortInfo(assNumber) {
  return request({
    url: '/goods/main/getAssortInfo/' + assNumber,
    method: 'get'
  })
}

export function listNotinShop(query) {
  return request({
    url: '/goods/main/listNotinShop',
    method: 'get',
    params: query
  })
}
